%
% Status : main Dynare file 
%
% Warning : this file is generated automatically by Dynare
%           from model file (.mod)

clear all
tic;
global M_ oo_ options_ ys0_ ex0_ estimation_info
options_ = [];
M_.fname = 'a15_markups_cbase';
%
% Some global variables initialization
%
global_initialization;
diary off;
diary('a15_markups_cbase.log');
M_.exo_names = 'e';
M_.exo_names_tex = 'e';
M_.exo_names_long = 'e';
M_.exo_names = char(M_.exo_names, 'u');
M_.exo_names_tex = char(M_.exo_names_tex, 'u');
M_.exo_names_long = char(M_.exo_names_long, 'u');
M_.endo_names = 'y';
M_.endo_names_tex = 'y';
M_.endo_names_long = 'y';
M_.endo_names = char(M_.endo_names, 'c');
M_.endo_names_tex = char(M_.endo_names_tex, 'c');
M_.endo_names_long = char(M_.endo_names_long, 'c');
M_.endo_names = char(M_.endo_names, 'k');
M_.endo_names_tex = char(M_.endo_names_tex, 'k');
M_.endo_names_long = char(M_.endo_names_long, 'k');
M_.endo_names = char(M_.endo_names, 'x');
M_.endo_names_tex = char(M_.endo_names_tex, 'x');
M_.endo_names_long = char(M_.endo_names_long, 'x');
M_.endo_names = char(M_.endo_names, 'l');
M_.endo_names_tex = char(M_.endo_names_tex, 'l');
M_.endo_names_long = char(M_.endo_names_long, 'l');
M_.endo_names = char(M_.endo_names, 'lambda');
M_.endo_names_tex = char(M_.endo_names_tex, 'lambda');
M_.endo_names_long = char(M_.endo_names_long, 'lambda');
M_.endo_names = char(M_.endo_names, 'nu');
M_.endo_names_tex = char(M_.endo_names_tex, 'nu');
M_.endo_names_long = char(M_.endo_names_long, 'nu');
M_.endo_names = char(M_.endo_names, 'r');
M_.endo_names_tex = char(M_.endo_names_tex, 'r');
M_.endo_names_long = char(M_.endo_names_long, 'r');
M_.endo_names = char(M_.endo_names, 'w');
M_.endo_names_tex = char(M_.endo_names_tex, 'w');
M_.endo_names_long = char(M_.endo_names_long, 'w');
M_.endo_names = char(M_.endo_names, 'mu');
M_.endo_names_tex = char(M_.endo_names_tex, 'mu');
M_.endo_names_long = char(M_.endo_names_long, 'mu');
M_.endo_names = char(M_.endo_names, 'q');
M_.endo_names_tex = char(M_.endo_names_tex, 'q');
M_.endo_names_long = char(M_.endo_names_long, 'q');
M_.endo_names = char(M_.endo_names, 'S');
M_.endo_names_tex = char(M_.endo_names_tex, 'S');
M_.endo_names_long = char(M_.endo_names_long, 'S');
M_.endo_names = char(M_.endo_names, 'Sp');
M_.endo_names_tex = char(M_.endo_names_tex, 'Sp');
M_.endo_names_long = char(M_.endo_names_long, 'Sp');
M_.endo_names = char(M_.endo_names, 'g');
M_.endo_names_tex = char(M_.endo_names_tex, 'g');
M_.endo_names_long = char(M_.endo_names_long, 'g');
M_.endo_names = char(M_.endo_names, 'dy');
M_.endo_names_tex = char(M_.endo_names_tex, 'dy');
M_.endo_names_long = char(M_.endo_names_long, 'dy');
M_.endo_names = char(M_.endo_names, 'z_a');
M_.endo_names_tex = char(M_.endo_names_tex, 'z\_a');
M_.endo_names_long = char(M_.endo_names_long, 'z_a');
M_.endo_names = char(M_.endo_names, 'z_g');
M_.endo_names_tex = char(M_.endo_names_tex, 'z\_g');
M_.endo_names_long = char(M_.endo_names_long, 'z_g');
M_.endo_names = char(M_.endo_names, 'AUX_ENDO_LAG_16_1');
M_.endo_names_tex = char(M_.endo_names_tex, 'AUX\_ENDO\_LAG\_16\_1');
M_.endo_names_long = char(M_.endo_names_long, 'AUX_ENDO_LAG_16_1');
M_.param_names = 'beta';
M_.param_names_tex = 'beta';
M_.param_names_long = 'beta';
M_.param_names = char(M_.param_names, 'psi');
M_.param_names_tex = char(M_.param_names_tex, 'psi');
M_.param_names_long = char(M_.param_names_long, 'psi');
M_.param_names = char(M_.param_names, 'delta');
M_.param_names_tex = char(M_.param_names_tex, 'delta');
M_.param_names_long = char(M_.param_names_long, 'delta');
M_.param_names = char(M_.param_names, 'alpha');
M_.param_names_tex = char(M_.param_names_tex, 'alpha');
M_.param_names_long = char(M_.param_names_long, 'alpha');
M_.param_names = char(M_.param_names, 'gamma');
M_.param_names_tex = char(M_.param_names_tex, 'gamma');
M_.param_names_long = char(M_.param_names_long, 'gamma');
M_.param_names = char(M_.param_names, 'gss');
M_.param_names_tex = char(M_.param_names_tex, 'gss');
M_.param_names_long = char(M_.param_names_long, 'gss');
M_.param_names = char(M_.param_names, 'sigma');
M_.param_names_tex = char(M_.param_names_tex, 'sigma');
M_.param_names_long = char(M_.param_names_long, 'sigma');
M_.param_names = char(M_.param_names, 'theta');
M_.param_names_tex = char(M_.param_names_tex, 'theta');
M_.param_names_long = char(M_.param_names_long, 'theta');
M_.param_names = char(M_.param_names, 'phi');
M_.param_names_tex = char(M_.param_names_tex, 'phi');
M_.param_names_long = char(M_.param_names_long, 'phi');
M_.param_names = char(M_.param_names, 'N');
M_.param_names_tex = char(M_.param_names_tex, 'N');
M_.param_names_long = char(M_.param_names_long, 'N');
M_.param_names = char(M_.param_names, 'eta');
M_.param_names_tex = char(M_.param_names_tex, 'eta');
M_.param_names_long = char(M_.param_names_long, 'eta');
M_.param_names = char(M_.param_names, 'muc');
M_.param_names_tex = char(M_.param_names_tex, 'muc');
M_.param_names_long = char(M_.param_names_long, 'muc');
M_.param_names = char(M_.param_names, 'h_prime');
M_.param_names_tex = char(M_.param_names_tex, 'h\_prime');
M_.param_names_long = char(M_.param_names_long, 'h_prime');
M_.param_names = char(M_.param_names, 'e_bar');
M_.param_names_tex = char(M_.param_names_tex, 'e\_bar');
M_.param_names_long = char(M_.param_names_long, 'e_bar');
M_.param_names = char(M_.param_names, 'mu_bar');
M_.param_names_tex = char(M_.param_names_tex, 'mu\_bar');
M_.param_names_long = char(M_.param_names_long, 'mu_bar');
M_.param_names = char(M_.param_names, 'a');
M_.param_names_tex = char(M_.param_names_tex, 'a');
M_.param_names_long = char(M_.param_names_long, 'a');
M_.param_names = char(M_.param_names, 'b');
M_.param_names_tex = char(M_.param_names_tex, 'b');
M_.param_names_long = char(M_.param_names_long, 'b');
M_.param_names = char(M_.param_names, 'rho_a');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_a');
M_.param_names_long = char(M_.param_names_long, 'rho_a');
M_.param_names = char(M_.param_names, 'rho_g_1');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_g\_1');
M_.param_names_long = char(M_.param_names_long, 'rho_g_1');
M_.param_names = char(M_.param_names, 'rho_g_2');
M_.param_names_tex = char(M_.param_names_tex, 'rho\_g\_2');
M_.param_names_long = char(M_.param_names_long, 'rho_g_2');
M_.param_names = char(M_.param_names, 'var_e');
M_.param_names_tex = char(M_.param_names_tex, 'var\_e');
M_.param_names_long = char(M_.param_names_long, 'var_e');
M_.param_names = char(M_.param_names, 'var_u');
M_.param_names_tex = char(M_.param_names_tex, 'var\_u');
M_.param_names_long = char(M_.param_names_long, 'var_u');
M_.exo_det_nbr = 0;
M_.exo_nbr = 2;
M_.endo_nbr = 18;
M_.param_nbr = 22;
M_.orig_endo_nbr = 17;
M_.aux_vars(1).endo_index = 18;
M_.aux_vars(1).type = 1;
M_.aux_vars(1).orig_index = 17;
M_.aux_vars(1).orig_lead_lag = -1;
M_.Sigma_e = zeros(2, 2);
M_.Correlation_matrix = eye(2, 2);
M_.H = 0;
M_.Correlation_matrix_ME = 1;
M_.sigma_e_is_diagonal = 1;
options_.block=0;
options_.bytecode=0;
options_.use_dll=0;
erase_compiled_function('a15_markups_cbase_static');
erase_compiled_function('a15_markups_cbase_dynamic');
M_.lead_lag_incidence = [
 0 7 25;
 1 8 26;
 2 9 0;
 3 10 27;
 0 11 0;
 0 12 28;
 0 13 29;
 0 14 30;
 0 15 0;
 0 16 31;
 0 17 0;
 0 18 0;
 0 19 32;
 0 20 0;
 0 21 0;
 4 22 0;
 5 23 0;
 6 24 0;]';
M_.nstatic = 6;
M_.nfwrd   = 6;
M_.npred   = 4;
M_.nboth   = 2;
M_.nsfwrd   = 8;
M_.nspred   = 6;
M_.ndynamic   = 12;
M_.equations_tags = {
};
M_.static_and_dynamic_models_differ = 0;
M_.exo_names_orig_ord = [1:2];
M_.maximum_lag = 1;
M_.maximum_lead = 1;
M_.maximum_endo_lag = 1;
M_.maximum_endo_lead = 1;
oo_.steady_state = zeros(18, 1);
M_.maximum_exo_lag = 0;
M_.maximum_exo_lead = 0;
oo_.exo_steady_state = zeros(2, 1);
M_.params = NaN(22, 1);
M_.NNZDerivatives = zeros(3, 1);
M_.NNZDerivatives(1) = 68;
M_.NNZDerivatives(2) = -1;
M_.NNZDerivatives(3) = -1;
load parameterfile;
set_param_value('a',a_p);               
set_param_value('b',b_p);               
set_param_value('rho_g_1',rho_g_1_p);   
set_param_value('rho_g_2',rho_g_2_p);   
set_param_value('gamma',gamma_p);       
set_param_value('N',N_p);               
set_param_value('var_e',var_e_p);       
set_param_value('var_u',var_u_p);       
set_param_value('phi',phi_p);           
M_.params( 8 ) = 2;
theta = M_.params( 8 );
M_.params( 4 ) = 0.35;
alpha = M_.params( 4 );
M_.params( 1 ) = 0.993;
beta = M_.params( 1 );
M_.params( 3 ) = 0.025;
delta = M_.params( 3 );
M_.params( 2 ) = 0.4;
psi = M_.params( 2 );
M_.params( 18 ) = 0.95;
rho_a = M_.params( 18 );
M_.params( 7 ) = 4;
sigma = M_.params( 7 );
M_.params( 11 ) = 10;
eta = M_.params( 11 );
M_.params( 6 ) = (-1.6);
gss = M_.params( 6 );
M_.params( 12 ) = (M_.params(11)*(M_.params(10)-1)+M_.params(7))/(M_.params(11)*(M_.params(10)-1)+M_.params(7)-M_.params(10));
muc = M_.params( 12 );
M_.params( 15 ) = 1.1;
mu_bar = M_.params( 15 );
M_.params( 13 ) = (1-M_.params(1)*M_.params(5))*(M_.params(12)-M_.params(15))/(M_.params(12)*(M_.params(15)-1));
h_prime = M_.params( 13 );
M_.params( 14 ) = (M_.params(11)*(M_.params(10)-1)+M_.params(7))/M_.params(10);
e_bar = M_.params( 14 );
%
% INITVAL instructions
%
options_.initval_file = 0;
oo_.steady_state( 1 ) = 0.009950330853168092;
oo_.steady_state( 2 ) = (-0.5798184952529421);
oo_.steady_state( 3 ) = 2.128231705849268;
oo_.steady_state( 4 ) = (-1.6094379124341);
oo_.steady_state( 5 ) = (-1.108662624521611);
oo_.steady_state( 12 ) = 0;
oo_.steady_state( 13 ) = 0;
oo_.steady_state( 10 ) = 0.3;
oo_.steady_state( 11 ) = 0;
oo_.steady_state( 1 ) = 0;
oo_.steady_state( 8 ) = (-3.506557897319982);
oo_.steady_state( 9 ) = 0.4885800148186709;
oo_.steady_state( 11 ) = log(M_.params(1));
oo_.steady_state( 16 ) = 0;
oo_.steady_state( 17 ) = 0;
oo_.steady_state(18)=oo_.steady_state(17);
if M_.exo_nbr > 0;
	oo_.exo_simul = [ones(M_.maximum_lag,1)*oo_.exo_steady_state'];
end;
if M_.exo_det_nbr > 0;
	oo_.exo_det_simul = [ones(M_.maximum_lag,1)*oo_.exo_det_steady_state'];
end;
%
% SHOCKS instructions
%
make_ex_;
M_.exo_det_length = 0;
M_.Sigma_e(1, 1) = M_.params(21);
M_.Sigma_e(2, 2) = M_.params(22);
steady;
oo_.dr.eigval = check(M_,options_,oo_);
options_.drop = 1000;
options_.irf = 20;
options_.nograph = 1;
options_.noprint = 1;
options_.order = 1;
options_.periods = 10000;
var_list_=[];
info = stoch_simul(var_list_);
save('a15_markups_cbase_results.mat', 'oo_', 'M_', 'options_');
if exist('estim_params_', 'var') == 1
  save('a15_markups_cbase_results.mat', 'estim_params_', '-append');
end
if exist('bayestopt_', 'var') == 1
  save('a15_markups_cbase_results.mat', 'bayestopt_', '-append');
end
if exist('dataset_', 'var') == 1
  save('a15_markups_cbase_results.mat', 'dataset_', '-append');
end
if exist('estimation_info', 'var') == 1
  save('a15_markups_cbase_results.mat', 'estimation_info', '-append');
end


disp(['Total computing time : ' dynsec2hms(toc) ]);
if ~isempty(lastwarn)
  disp('Note: warning(s) encountered in MATLAB/Octave code')
end
diary off
